﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Class01
{
    class Student
    { 
    private string name;
    private int age;
    private string sex;

    public string Name
    {
        get { return this.name; }
        set
        {
            this.name = value;
            if (name.Equals("马斯克"))
            {
                Console.WriteLine("你输入的名字有误！");
                this.name = "";
            }
        }
    }
    public int Age
    {
        get { return this.age; }
        set { this.age = value; }
    }
    public string Sex
    {
        get { return this.sex; }
        set
        {
            this.sex = value;
            if (sex.Equals("人妖"))
            {
                Console.WriteLine("你输入的性别有误！");
                this.sex = "人妖";
            }
        }
    }
    public void Introduce()
    {
        Console.WriteLine("我的名字是{0}，我的年龄是{1}，我的性别是{2}", this.name, this.age, this.sex);
    }
}
}
